<template>
  <el-row class="calculate">
    <el-col>
      <el-row>
        <el-col>计算</el-col>
        <el-col>
          <el-row class="form">
            <el-form :mode="calculateForm" :inline="true" ref="calculateForm">
              <el-col :span="12">
                <el-form-item label="票面金额">
                  <el-input v-model="calculateForm.amounts"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="票据类型">
                  <el-button-group>
                    <el-button icon="el-icon-arrow-left">电子票据</el-button>
                    <el-button type="primary">
                      纸质票据
                      <i class="el-icon-arrow-right el-icon--right"></i>
                    </el-button>
                  </el-button-group>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="年息利率">
                  <el-input v-model="calculateForm.annualInterestRate"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="月息利率">
                  <el-input v-model="calculateForm.mensemInterestRate"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="贴现日期">
                  <el-date-picker
                    type="date"
                    placeholder="选择日期"
                    v-model="calculateForm.discountDate"
                    style="width: 100%;"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="到期日期">
                  <el-date-picker
                    type="date"
                    placeholder="选择日期"
                    v-model="calculateForm.matureDate"
                    style="width: 100%;"
                  ></el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="调整天数">
                  <el-input v-model="calculateForm.adjustDays"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="手续费用">
                  <el-input v-model="calculateForm.processingFees"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="打款费用">
                  <el-input v-model="calculateForm.remittanceFees"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="其他费用">
                  <el-input v-model="calculateForm.otherFees"></el-input>
                </el-form-item>
              </el-col>
            </el-form>
          </el-row>
          <el-row>
            <el-col :span="24" style="text-align:center;">
              <el-button type="danger" @click="reset" style="width: 180px;">重置</el-button>
              <el-button type="primary" @click="calculate" style="width: 180px;">计算</el-button>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
    </el-col>
    <el-col>
      <el-row>
        <el-col>计算结果</el-col>
        <el-row class="result">
          <el-col :span="12">
            计息天数:
            <span></span>天
          </el-col>
          <el-col :span="12">
            每十万贴息:
            <span></span>元
          </el-col>
          <el-col :span="12">
            贴现利息:
            <span></span>元
          </el-col>
          <el-col :span="12">
            贴现金额:
            <span class="red"></span>元
          </el-col>
        </el-row>
      </el-row>
    </el-col>
  </el-row>
</template>
<script>
export default {
  name: "Calculate",
  data() {
    return {
      calculateForm: {
        amounts: "", // 票面金额
        annualInterestRate: "", // 年息利率
        mensemInterestRate: "", // 月息利率
        discountDate: "", // 贴现日期
        matureDate: "", // 到期日期
        adjustDays: "", // 调整天数
        processingFees: "", // 手续费用
        remittanceFees: "", // 打款费用
        otherFees: "" // 其他费用
      },
      calculateResult: {
        interestDays: "",
        discount: ""
      }
    };
  },
  methods: {
    reset() {
      this.calculateForm.amounts = "";
      this.calculateForm.annualInterestRate = "";
      this.calculateForm.mensemInterestRate = "";
      this.calculateForm.discountDate = "";
      this.calculateForm.matureDate = "";
      this.calculateForm.adjustDays = "";
      this.calculateForm.processingFees = "";
      this.calculateForm.remittanceFees = "";
      this.calculateForm.otherFees = "";
    },
    calculate() {
      console.log("获取表单数据", this.calculateForm);
    }
  }
};
</script>
<style lang="scss" scoped>
.calculate {
  .form {
    background-color: #fff;
    border-radius: 8px;
  }
}
</style>